import itertools
import zipfile

filename = "加密文件.zip"

def uncompress(filename, password):
    try:
        with zipfile.ZipFile(filename) as zfile:
            zfile.extractall("./", pwd=password.encode("utf-8"))
        return True
    except:
        return False

chars = "abcdefghijklmnopqrstuvwxyz0123456789"
for c in itertools.permutations(chars, 4):
    password = "".join(c)
    print(password)
    result = uncompress(filename, password)
    if not result:
        print("解压失败", password)
    else:
        print("解压成功", password)
        break